package com.woniuxy.oa.utils;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class TimeAddAnotherTime {

	/**

	 *  处理时间

	 * @param oldTime  原时间

	 * @param add  增加时间
	 * @throws ParseException 

	 */

	public static String  TimeAdd(String oldTime,String add) throws ParseException {

		int addMit = Integer.valueOf(add);
		//HH表示24小时制
		DateFormat df = new SimpleDateFormat("HH:mm:ss");

		Date date = df.parse(oldTime);

		Date expireTime = new Date(date.getTime() + addMit*60*1000);

		String newTime = df.format(expireTime);

		return newTime;

	}

	

	public static void main(String[] args) throws ParseException{

		String timeAdd = TimeAdd("12:30:00", "30");

		System.out.println(timeAdd);

	}

}

